﻿namespace ExamV5.GradeInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmUserGradeAN : Page
    {
        protected DropDownList DDLDept;
        protected DropDownList DDLUPDept;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private HttpCookie httpCookie_4 = null;
        private int int_0 = 0;
        protected Label labSumTable;
        protected Label labTitle;
        private PublicFun publicFun_0 = new PublicFun();
        protected ScriptManager SM;
        private string string_0 = "";
        private string string_1 = "";
        private string string_2 = "";
        private string string_3 = "";
        protected UpdatePanel UPPart;

        protected void DDLDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.method_1();
        }

        protected void DDLUPDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.DDLDept.Items.Clear();
            this.publicFun_0.LoadDeptInfo(this.DDLDept, this.DDLUPDept.SelectedItem.Value, this.httpCookie_0.Value, "B");
            if (this.DDLDept.Items.Count == 0)
            {
                if (!(this.DDLUPDept.SelectedItem.Value == "0"))
                {
                    ListItem item = new ListItem(this.DDLUPDept.SelectedItem.Text, this.DDLUPDept.SelectedItem.Value);
                    this.DDLDept.Items.Add(item);
                }
                else
                {
                    ListItem item2 = new ListItem("--所有部门--", "0");
                    this.DDLDept.Items.Insert(0, item2);
                }
            }
        }

        private void method_0(string string_4, string string_5, string string_6, string string_7)
        {
            if (string_4 != "")
            {
                int index = 0;
                double num2 = 0.0;
                string[] strArray5 = this.string_1.Split(new char[] { ',' });
                string[] strArray = this.string_1.Split(new char[] { ',' });
                string[] strArray3 = this.string_1.Split(new char[] { ',' });
                string[] strArray6 = string_5.Split(new char[] { '|' });
                int num = 0;
                while (num < strArray.Length)
                {
                    strArray[num] = "0";
                    strArray3[num] = "0";
                    num++;
                }
                string connectionString = ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
                string cmdText = "Select SubjectID from RubricInfo where ID in(" + string_4.Replace("#", ",") + "0) order by " + string_6.Trim();
                string text1 = ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
                SqlConnection connection = new SqlConnection(connectionString);
                connection.Open();
                SqlCommand command = new SqlCommand(cmdText, connection);
                SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                while (reader.Read())
                {
                    num = 0;
                    while (num < strArray5.Length)
                    {
                        if (reader["SubjectID"].ToString() == strArray5[num].Trim())
                        {
                            if (strArray6[index].Trim() != "")
                            {
                                num2 = Convert.ToDouble(strArray[num]) + Convert.ToDouble(strArray6[index].Trim());
                                strArray[num] = num2.ToString("0.00");
                            }
                            num2 = Convert.ToDouble(strArray3[num]) + Convert.ToDouble(string_7.Trim());
                            strArray3[num] = num2.ToString("0.00");
                        }
                        num++;
                    }
                    index++;
                }
                reader.Close();
                command.Dispose();
                connection.Close();
                connection.Dispose();
                string[] strArray2 = this.string_2.Split(new char[] { ',' });
                string[] strArray4 = this.string_3.Split(new char[] { ',' });
                this.string_2 = "";
                this.string_3 = "";
                for (num = 0; num < strArray.Length; num++)
                {
                    num2 = Convert.ToDouble(strArray[num]) + Convert.ToDouble(strArray2[num].Trim());
                    this.string_2 = this.string_2 + num2.ToString("0.00") + ",";
                    this.string_3 = this.string_3 + ((Convert.ToDouble(strArray3[num]) + Convert.ToDouble(strArray4[num].Trim()))).ToString("0.00") + ",";
                }
                if (this.string_2.Length > 0)
                {
                    this.string_2 = this.string_2.Substring(0, this.string_2.Length - 1);
                    this.string_3 = this.string_3.Substring(0, this.string_3.Length - 1);
                }
            }
        }

        private void method_1()
        {
            int num4;
            string connectionString = ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
            SqlConnection connection = new SqlConnection(connectionString);
            connection.Open();
            SqlCommand command = new SqlCommand("select SubjectName,SubjectID,ExamName from PaperInfo where ID=" + this.int_0, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader.Read())
            {
                this.labTitle.Text = "〖" + this.DDLDept.SelectedItem.Text.Replace("│", "").Replace("├", "") + "〗〖" + reader["ExamName"].ToString() + "〗所有考生得分综合分析表";
                this.string_0 = reader["SubjectName"].ToString();
                this.string_1 = reader["SubjectID"].ToString();
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
            string[] strArray10 = this.string_1.Split(new char[] { ',' });
            string[] strArray13 = this.string_0.Split(new char[] { '、' });
            string[] strArray11 = this.string_1.Split(new char[] { ',' });
            string[] strArray12 = this.string_1.Split(new char[] { ',' });
            string[] strArray = this.string_1.Split(new char[] { ',' });
            string[] strArray2 = this.string_1.Split(new char[] { ',' });
            this.labSumTable.Text = "<table id='tableABC1' borderColor='#cccccc'   cellSpacing='0'  cellPadding='0' width='100%' align='center' border='1' class='tableStyle'>";
            this.labSumTable.Text = this.labSumTable.Text + "<tr height='30'>";
            this.labSumTable.Text = this.labSumTable.Text + "<td align='center'    rowspan=2><B>考生信息</B></td>";
            for (num4 = 0; num4 < strArray13.Length; num4++)
            {
                this.labSumTable.Text = this.labSumTable.Text + "<td align='center' colspan=3><B>" + strArray13[num4].ToString() + "</B></td>";
                strArray[num4] = "0";
                strArray2[num4] = "0";
            }
            this.labSumTable.Text = this.labSumTable.Text + "<td align='center' colspan=3><B>合 计</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "</tr>";
            this.labSumTable.Text = this.labSumTable.Text + "<tr height='30'>";
            num4 = 0;
            while (num4 < strArray13.Length)
            {
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>总分值</B></td>";
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>得分值</B></td>";
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>得分率</B></td>";
                num4++;
            }
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center'  ><B>总分值</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center'  ><B>得分值</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center'  ><B>得分率</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "</tr>";
            string str10 = "";
            string cmdText = "";
            string str2 = "0";
            double num2 = 0.0;
            int num3 = 0;
            cmdText = "select  a.UserCode,a.UserName from UserInfo a,DeptInfo b,ExamUser c where (c.Flag<>'A' and c.Flag<>'B') and c.UserCode=a.UserCode and c.PaperID=" + this.int_0 + " and a.DeptID=b.ID ";
            if (this.DDLDept.SelectedItem.Value != "0")
            {
                cmdText = cmdText + " and a.DeptID in (select b.ID from DeptInfo b where " + this.publicFun_0.GetManagDeptID(this.publicFun_0.CheckString(this.DDLDept.SelectedItem.Value)) + ")";
            }
            SqlConnection connection2 = new SqlConnection(connectionString);
            connection2.Open();
            SqlCommand command2 = new SqlCommand(cmdText, connection2);
            SqlDataReader reader2 = command2.ExecuteReader(CommandBehavior.CloseConnection);
            while (reader2.Read())
            {
                num3++;
                this.string_2 = "";
                this.string_3 = "";
                for (int i = 0; i < strArray10.Length; i++)
                {
                    strArray11[i] = "0";
                    strArray12[i] = "0";
                    this.string_2 = this.string_2 + "0,";
                    this.string_3 = this.string_3 + "0,";
                }
                if (this.string_2.Length > 0)
                {
                    this.string_2 = this.string_2.Substring(0, this.string_2.Length - 1);
                    this.string_3 = this.string_3.Substring(0, this.string_3.Length - 1);
                }
                str10 = reader2["UserCode"].ToString();
                this.labSumTable.Text = this.labSumTable.Text + "<tr height='30'>";
                this.labSumTable.Text = this.labSumTable.Text + "<td align='center'><B>" + reader2["UserName"].ToString() + "(" + reader2["UserCode"].ToString() + ")</B></td>";
                string str3 = "0";
                SqlConnection connection3 = new SqlConnection(connectionString);
                connection3.Open();
                SqlCommand command3 = new SqlCommand(string.Concat(new object[] { "select c.FenDist,a.RubricS,a.RubricD,a.RubricB,a.RubricF,a.RubricA,a.RubricC,a.RubricT,a.RubricAn,a.RubricO,a.RubricJ,a.SortInfo,b.RubricSFen,b.RubricDFen,b.RubricBFen,b.RubricFFen,b.RubricAFen,b.RubricCFen,b.RubricTFen,b.RubricAnFen,b.RubricOFen,b.RubricJFen,b.CheckUserFFen,b.CheckUserAFen,b.CheckUserCFen,b.CheckUserTFen,b.CheckUserAnFen,b.CheckUserOFen,b.CheckUserJFen,c.PaperFen,d.GetCountFen from PaperData a,CheckPaper b,PaperInfo c,ExamUser d where a.UserCode=b.UserCode and a.UserCode=d.UserCode and a.PaperID=b.PaperID and b.PaperID=c.ID and c.ID=d.PaperID and  d.UserCode=a.UserCode and  b.UserCode='", str10, "' and a.PaperID=", this.int_0 }), connection3);
                SqlDataReader reader3 = command3.ExecuteReader(CommandBehavior.CloseConnection);
                if (reader3.Read())
                {
                    int num6;
                    string[] strArray5;
                    string[] strArray8;
                    double num7;
                    str2 = reader3["PaperFen"].ToString();
                    str3 = reader3["GetCountFen"].ToString();
                    num2 += Convert.ToDouble(reader3["GetCountFen"].ToString());
                    string[] strArray6 = reader3["SortInfo"].ToString().Split(new char[] { '#' });
                    string[] strArray7 = reader3["FenDist"].ToString().Split(new char[] { '#' });
                    if (reader3["RubricS"].ToString().Trim() != "")
                    {
                        this.method_0(reader3["RubricS"].ToString().Trim(), reader3["RubricSFen"].ToString().Trim(), strArray6[0].Trim(), strArray7[0].Trim());
                    }
                    if (reader3["RubricD"].ToString().Trim() != "")
                    {
                        this.method_0(reader3["RubricD"].ToString().Trim(), reader3["RubricDFen"].ToString().Trim(), strArray6[1].Trim(), strArray7[1].Trim());
                    }
                    if (reader3["RubricB"].ToString().Trim() != "")
                    {
                        this.method_0(reader3["RubricB"].ToString().Trim(), reader3["RubricBFen"].ToString().Trim(), strArray6[2].Trim(), strArray7[2].Trim());
                    }
                    if (reader3["RubricF"].ToString().Trim() != "")
                    {
                        string str9 = "";
                        if (reader3["CheckUserFFen"].ToString().Trim() != "")
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricFFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserFFen"].ToString().Trim().Split(new char[] { '|' });
                            num6 = 0;
                            while (num6 < strArray5.Length)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    num7 = Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim());
                                    str9 = str9 + num7.ToString("0.00") + "|";
                                }
                                num6++;
                            }
                        }
                        else
                        {
                            str9 = reader3["RubricFFen"].ToString().Trim();
                        }
                        this.method_0(reader3["RubricF"].ToString().Trim(), str9, strArray6[3].Trim(), strArray7[3].Trim());
                    }
                    if (reader3["RubricA"].ToString().Trim() != "")
                    {
                        string str8 = "";
                        if (reader3["CheckUserAFen"].ToString().Trim() != "")
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricAFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserAFen"].ToString().Trim().Split(new char[] { '|' });
                            num6 = 0;
                            while (num6 < strArray5.Length)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    num7 = Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim());
                                    str8 = str8 + num7.ToString("0.00") + "|";
                                }
                                num6++;
                            }
                        }
                        else
                        {
                            str8 = reader3["RubricAFen"].ToString().Trim();
                        }
                        this.method_0(reader3["RubricA"].ToString().Trim(), str8, strArray6[4].Trim(), strArray7[4].Trim());
                    }
                    if (reader3["RubricC"].ToString().Trim() != "")
                    {
                        string str7 = "";
                        if (reader3["CheckUserCFen"].ToString().Trim() == "")
                        {
                            str7 = reader3["RubricCFen"].ToString().Trim();
                        }
                        else
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricCFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserCFen"].ToString().Trim().Split(new char[] { '|' });
                            num6 = 0;
                            while (num6 < strArray5.Length)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    num7 = Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim());
                                    str7 = str7 + num7.ToString("0.00") + "|";
                                }
                                num6++;
                            }
                        }
                        this.method_0(reader3["RubricC"].ToString().Trim(), str7, strArray6[5].Trim(), strArray7[5].Trim());
                    }
                    if (reader3["RubricT"].ToString().Trim() != "")
                    {
                        string str6 = "";
                        if (reader3["CheckUserTFen"].ToString().Trim() != "")
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricTFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserTFen"].ToString().Trim().Split(new char[] { '|' });
                            num6 = 0;
                            while (num6 < strArray5.Length)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    num7 = Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim());
                                    str6 = str6 + num7.ToString("0.00") + "|";
                                }
                                num6++;
                            }
                        }
                        else
                        {
                            str6 = reader3["RubricTFen"].ToString().Trim();
                        }
                        this.method_0(reader3["RubricT"].ToString().Trim(), str6, strArray6[6].Trim(), strArray7[6].Trim());
                    }
                    if (reader3["RubricAn"].ToString().Trim() != "")
                    {
                        string str5 = "";
                        if (reader3["CheckUserAnFen"].ToString().Trim() != "")
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricAnFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserAnFen"].ToString().Trim().Split(new char[] { '|' });
                            num6 = 0;
                            while (num6 < strArray5.Length)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    num7 = Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim());
                                    str5 = str5 + num7.ToString("0.00") + "|";
                                }
                                num6++;
                            }
                        }
                        else
                        {
                            str5 = reader3["RubricAnFen"].ToString().Trim();
                        }
                        this.method_0(reader3["RubricAn"].ToString().Trim(), str5, strArray6[7].Trim(), strArray7[7].Trim());
                    }
                    if (reader3["RubricO"].ToString().Trim() != "")
                    {
                        string str4 = "";
                        if (reader3["CheckUserOFen"].ToString().Trim() == "")
                        {
                            str4 = reader3["RubricOFen"].ToString().Trim();
                        }
                        else
                        {
                            num7 = 0.0;
                            strArray5 = reader3["RubricOFen"].ToString().Trim().Split(new char[] { '|' });
                            strArray8 = reader3["CheckUserOFen"].ToString().Trim().Split(new char[] { '|' });
                            for (num6 = 0; num6 < strArray5.Length; num6++)
                            {
                                if (strArray5[num6].Trim() != "")
                                {
                                    str4 = str4 + ((Convert.ToDouble(strArray5[num6].Trim()) + Convert.ToDouble(strArray8[num6].Trim()))).ToString("0.00") + "|";
                                }
                            }
                        }
                        this.method_0(reader3["RubricO"].ToString().Trim(), str4, strArray6[8].Trim(), strArray7[8].Trim());
                    }
                }
                reader3.Close();
                command3.Dispose();
                connection3.Close();
                connection3.Dispose();
                string[] strArray3 = this.string_2.Split(new char[] { ',' });
                string[] strArray4 = this.string_3.Split(new char[] { ',' });
                double num5 = 0.0;
                num4 = 0;
                while (num4 < strArray3.Length)
                {
                    this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + strArray4[num4].Trim() + "</td>";
                    this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + strArray3[num4].Trim() + "</td>";
                    num5 = Convert.ToDouble(strArray[num4]) + Convert.ToDouble(strArray3[num4].Trim());
                    strArray[num4] = num5.ToString("0.00");
                    strArray2[num4] = strArray4[num4].Trim();
                    if (!(Convert.ToDouble(strArray4[num4].Trim()) == 0.0))
                    {
                        num5 = Convert.ToDouble(strArray3[num4].Trim()) / Convert.ToDouble(strArray4[num4].Trim());
                    }
                    else
                    {
                        num5 = 0.0;
                    }
                    this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + num5.ToString("0.00%") + "</td>";
                    num4++;
                }
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + str2.Trim() + "</td>";
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + str3.Trim() + "</td>";
                if (Convert.ToDouble(str2.Trim()) == 0.0)
                {
                    num5 = 0.0;
                }
                else
                {
                    num5 = Convert.ToDouble(str3.Trim()) / Convert.ToDouble(str2.Trim());
                }
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' >" + num5.ToString("0.00%") + "</td>";
                this.labSumTable.Text = this.labSumTable.Text + "</tr>";
            }
            reader2.Close();
            command2.Dispose();
            connection2.Close();
            connection2.Dispose();
            double num = 0.0;
            this.labSumTable.Text = this.labSumTable.Text + "<tr height='25'>";
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>合 计</B></td>";
            for (num4 = 0; num4 < strArray.Length; num4++)
            {
                if (num3 != 0)
                {
                    num = Convert.ToDouble(strArray[num4]) / ((double) num3);
                }
                else
                {
                    num = 0.0;
                }
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + strArray2[num4].Trim() + "</B></td>";
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + num.ToString("0.00") + "</B></td>";
                if (!(Convert.ToDouble(strArray2[num4].Trim()) == 0.0))
                {
                    num /= Convert.ToDouble(strArray2[num4].Trim());
                }
                else
                {
                    num = 0.0;
                }
                this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + num.ToString("0.00%") + "</B></td>";
            }
            if (num3 == 0)
            {
                num = 0.0;
            }
            else
            {
                num = num2 / ((double) num3);
            }
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + str2.Trim() + "</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + num.ToString("0.00") + "</B></td>";
            if (Convert.ToDouble(str2.Trim()) == 0.0)
            {
                num = 0.0;
            }
            else
            {
                num /= Convert.ToDouble(str2.Trim());
            }
            this.labSumTable.Text = this.labSumTable.Text + "<td  align='center' ><B>" + num.ToString("0.00%") + "</B></td>";
            this.labSumTable.Text = this.labSumTable.Text + "</tr>";
            this.labSumTable.Text = this.labSumTable.Text + "</table>";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            this.httpCookie_4 = new HttpCookie("ExamDeptName");
            this.httpCookie_4 = base.Request.Cookies["ExamDeptName"];
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                this.httpCookie_4.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_4.Value));
                this.int_0 = Convert.ToInt32(base.Request["PaperID"]);
                this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString + "---考试得分综合报表分析";
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() != "Yes")
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BCheck", "alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')", true);
                    }
                    else if (this.httpCookie_2.Value == "A")
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BCheckA", "alert('考试成绩分析权限未开放！')", true);
                    }
                    else
                    {
                        this.DDLUPDept.DataTextField = "DeptName";
                        this.DDLUPDept.DataValueField = "ID";
                        if (!(this.httpCookie_2.Value == "C"))
                        {
                            this.DDLUPDept.DataSource = this.publicFun_0.RetrunDataView("select ID,DeptName from DeptInfo where ID=" + this.httpCookie_3.Value + " order by SortInfo,ID");
                        }
                        else
                        {
                            this.DDLUPDept.DataSource = this.publicFun_0.RetrunDataView("select ID,DeptName from DeptInfo where UPID=0  order by SortInfo,ID");
                        }
                        this.DDLUPDept.DataBind();
                        if (!(this.httpCookie_2.Value == "C"))
                        {
                            this.DDLDept.Items.Clear();
                            this.publicFun_0.LoadDeptInfo(this.DDLDept, this.DDLUPDept.SelectedItem.Value, this.httpCookie_0.Value, "B");
                            if (this.DDLDept.Items.Count == 0)
                            {
                                ListItem item = new ListItem(this.DDLUPDept.SelectedItem.Text, this.DDLUPDept.SelectedItem.Value);
                                this.DDLDept.Items.Add(item);
                            }
                        }
                        else
                        {
                            this.DDLUPDept.SelectedIndex = -1;
                            this.DDLDept.SelectedIndex = -1;
                            ListItem item2 = new ListItem("--所有单位--", "0");
                            ListItem item3 = new ListItem("--所有部门--", "0");
                            this.DDLDept.Items.Insert(0, item3);
                            this.DDLUPDept.Items.Insert(0, item2);
                        }
                        this.method_1();
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

